home *** CD-ROM | disk | FTP | other *** search
- MkFmx File manager Extension
- ----------------------------
-
- OverView
- --------
-
- This is a little test utility that I wrote in order to test the File
- manager extensions. However, I feel that other people might benefit
- from this, therefore I am uploading it here. The source, in turbo
- Pascal is included for anybody who wants to see how a file manager
- extension is done.
-
- This is freeware, so do whatever you want with it. I am (obviously)
- not providing any support, but would be very interested in any bugs
- or problems you may find. Please drop me a note at CIS 100012,1767
- Also, I would be interested to know if anybody actually finds this
- usefull. I fyou drop me a friendly note (at the above address), I
- will be encouraged to upload more of the utilities I will be
- developing.
-
- What it does
- ------------
-
- Basically, Mkfmx adds a new menu item to the standard File Manager
- menu. This new menu contains items which you, the user defines, and
- which correspond to programs. When a selection is made from this
- menu, the corresponding program is launched. The interesting feature
- is that, if one (or more) files are selected when the program gets
- launched, the program will receive these filenames as parameters.
- Many programs take filenames as parameters and act on them. The most
- trivial example is NOTEPAD, the default windows editor. If called
- with a filename parameter, it will just edit the file.
-
- The result is that, effectively you add new file proccessing commands
- to File manager.
- Any executable program can be attached to the menu entries, even
- DOS programs. Actually, there are many more DOS programs that take
- filename parameters than Windows programs, so I expect that this
- utility will be most used with DOS programs.
-
- By the way, we all know that windows allows you to assosiate
- particular file name extensions with a program, so you could,
- for example, associate an extension with a particular program,
- and just double-click on the filename to launch the program with
- the file as parameter. So why bother with MkFmx ?
-
- The answer is simple. If a particular file type can only be processed
- by one program, the above trick is enough. However, there are many
- cases that you need to associate a particular file type with more
- than one programs. Take for example the BMP format. Paintbrush deals
- with these files, but so do dozens of other programs. Which one should
- you associate with the BMP extension? The answer is, the most
- common. Then , if you want to process the file by another program,
- just add the program to mkfmx's menu, select the file, and select
- the corresponding command from the menu.
-
- Installation
- ------------
-
- To install MkFmx do the following:
-
- 1. Copy the file MKFMX.DLL wherever you want (the windows directory
- will do).
-
- 2. Edit the WINFILE.INI file (notepad can do that), and add the
- following sections:
-
- [AddOns]
- KMFMX=C:\win31\Mkfmx.dll (put here the equivalent full path to the DLL)
-
- [MkFmX]
- menuname=<Type here the name that you want to appear in the menu>
- programs=<Type the number of items in the menu>
- 1=title,progname,WorkingDir[,m]
- 2=<next item>
- ...
- ... <up to the last item>
-
- Explanation of settings:
-
- mnuname= defines the name of the item that will be added to the File
- Manager menu. Do not exceed 15 characters in length. If you want this
- menu to be activated by an ALT-combination, add the symbol & in front
- of the letter that should activate it. Example:
-
- menuname=&Tools
-
- adds the item Tools to the File manager menu, and associates the
- hotkey ALT-T with it.
-
- programs= defines how many items will appear on the menu
-
- The items are defined next, one per line, numbered according to
- the order you want them to appear on the menu.
-
- Each item consists of the following parts, separated by commas:
-
- a. Title. This is the word that will appear on the menu.
- Like the menuname, it can have the & sign define an accelarator
- letter. If the first letter is an underscore (_), this item
- is separated from the previous one in the menu by a line.
-
- b. program to execute. If the program is on the path, this can be
- just the program name. Otherwise, it must be the full path name
- to the program. It can have parameters as well.
-
- c. Working directory. This is optional. If defined, the current
- directory is changed to this setting before the program is run,
- a la program manager.
-
- d. The last item, if present can be one of the letters N,S,M and
- defines how the file name parameters are passed to the program
-
- S (the default) means that a different instance is created
- for each filename selected. Thus,if you select three files
- and activate an entry that has this format:
- notepad,notepad.exe,,S
- you will get three copies of notepad running at the same time,
- one for each file
-
- M signifies that the program can handle multiple parameters
- (many MDI applications can do that). Turbo pascal for windows
- is one such example. When multiple files are selected with this
- setting, the program is called ONCE, with all the file names
- passed as parameters on the command line. this results in multiple
- windows being opened.
-
- N signifies that the program does not handle file name parameters.
- The only reason you would put a selection like that in MKfmx's menu
- is to use it as a quick program launcher. The functionality of
- having a program like that act on the selected files is lost.
- As you will see in the example,this has its uses.
-
- If in doubt about the capabilities of the program you are setting
- up, leave this entry blank, which defaults to S (single parameter)
-
- Here is an example:
-
-
- [AddOns]
- Mkfmx=C:\win31\MkfmX.dll
-
- [MkFmX]
- menuname=&Addons
- programs=4
- 1=Notepad,notepad.exe
- 2=Ms,Ms.exe,,m
- 3=Paintbrush,paint.exe,c:\win31\paint
- 4=_Edit Winfile.ini,notepad.exe c:\win31\winfile.ini,,N
-
- This adds the menu item Addons to the file manager menu. This menu
- contains 4 selections and looks like that:
-
- Notepad
- Ms
- paintbrush
- ----------- <-- this line created by the _ in front
- Edit winfile.ini of the last item
-
- Item 1 starts notepad on the selected file(s)
- item 2 starts a DOS editor that can handle multiple parameters
- Item 3 starts paintbrush,changing directory to c:\win31\paint
- Item 4 allows you to edit the winfile.ini. This entry cannot be
- used with selected files (the N parameter). It is used as
- a handy way to configure MkFmx. (You will need to exit
- and restart file manager for the changes to take effect)
- This entry demonstrates also that the program executed can
- have hard-wired parameters
-
- Last, I have included a special capability, meant for those who
- want to modify and extend the source. The program will recognise
- in place of <programname> special "internal" commands. These should
- start with the sign @. When selected, instead of starting a program,
- they execute an command internal to MkFmX. Currently, there is only
- one such command:
-
- @RELOAD will reload the MkFMx menu. This is usefull after having edited
- the winfile.ini file while file manager is active. So the line:
-
- 5=Reload,@reload
-
- will do just that.
-
- Clearly, more internal commands like that can be added by programmers
-
- Phew!!! It took me longer to write these instructions than the actual
- program itself! Again, if you like it please drop me a note.
- Programmers are vain people, and they want to know if their
- contributions are appreciated!
-
-
- Mike Cariotoglou,
- Singular Computer Applications,
- Athens,Greece
-
- CIS 100012,1767
-
-